package com.example.demo.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Component
public class RedisMessageSender {

    @Autowired
    private RedisTemplate redisTemplate;

    public void sendMessage(String message) {
        redisTemplate.convertAndSend("chat-message", message);
    }
}
